package com.zfl.thread;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {

        ArrayList<String> list1 = new ArrayList<>();//左上
        ArrayList<String> list2 = new ArrayList<>();//右上
        ArrayList<String> list3 = new ArrayList<>();//左下
        ArrayList<String> list4 = new ArrayList<>();//右下
        ArrayList<String> list5 = new ArrayList<>();//前
        Scanner sc  = new Scanner(System.in);
        while(true) {
            String s = sc.nextLine();
            LocalDateTime now = LocalDateTime.now();
            System.out.println("当前日期时间: " + now);

            // 格式化输出
            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
            String formattedDateTime = now.format(formatter);
            switch (s) {
                case "1": list1.add(formattedDateTime);break;
                case "2": list1.add(formattedDateTime);break;
                case "3": list1.add(formattedDateTime);break;
                case "4": list1.add(formattedDateTime);break;
            }
        }
    }
}
